<?php
namespace Home\Model;
use Think\Model\RelationModel;
class PostModel extends RelationModel{
	protected $_link = array(
		'Comment' => array(
			'mapping_type'  => self::HAS_MANY,
			'class_name'    => 'Comment',
			'foreign_key'   => 'post_id',
			'mapping_limit' => 5,
			'relation_deep' => true,
		    'mapping_name'  => 'comments',
		    'mapping_order' => 'comment_date desc'
	    ),	   
	);
}

